<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:hr="http://java.sun.com/jsf/composite/autocomplete">

    <h:body>

        <ui:composition template="/resources/template/template.xhtml">

            <ui:define name="content">

                <h:form >
                    <p:panel >
                        <f:facet name="header" >
                            <h:outputLabel value="Employee Salary Detail Report" />
                        </f:facet>
                        <h:panelGrid columns="2" >
                            <h:outputLabel value="Salary Cycal" />
                            <p:selectOneMenu id="advanced" 
                                             value="#{hrReportController.reportKeyWord.salaryCycle}" 
                                             converter="salaryCycleConverter"                                      
                                             effect="fade" var="t" 
                                             filter="true" 
                                             filterMatchMode="startsWith"  >

                                <f:selectItems value="#{salaryCycleController.salaryCycles}" 
                                               var="theme" 
                                               itemLabel="#{theme.name}" 
                                               itemValue="#{theme}" ></f:selectItems>

                                <p:column style="width:10%" headerText="Name">
                                    <h:outputText value="#{t.name}" />
                                </p:column>

                                <p:column headerText="Year">
                                    <h:outputText value="#{t.salaryYear}" />
                                </p:column>
                                <p:column headerText="Month">
                                    <h:outputText value="#{t.salaryMonth}" />
                                </p:column>
                            </p:selectOneMenu>
                            <h:outputLabel value="Institution : "/>
                            <hr:institution value="#{hrReportController.reportKeyWord.institution}"/>
                            <h:outputLabel value="Department : "/>
                            <hr:department value="#{hrReportController.reportKeyWord.department}"/>
                            <h:outputLabel value="Employee : "/>
                            <hr:completeStaff value="#{hrReportController.reportKeyWord.staff}"/>
                            <h:outputLabel value="Staff Category : "/>
                            <hr:completeStaffCategory value="#{hrReportController.reportKeyWord.staffCategory}"/>
                            <h:outputLabel value="Staff Designation : "/>
                            <hr:completeDesignation value="#{hrReportController.reportKeyWord.designation}"/>
                            <h:outputLabel value="Staff Roster : "/>
                            <hr:completeRoster value="#{hrReportController.reportKeyWord.roster}"/>
                            <h:outputLabel value="Additional Details: "/>
                            <p:selectBooleanCheckbox value="#{hrReportController.reportKeyWord.additionalDetails}" />
                        </h:panelGrid>

                        <p:commandButton ajax="false" value="Process" action="#{hrReportController.createMonthEndReportNew()}"/>
                        <p:commandButton ajax="false" value="Excel" styleClass="noPrintButton" onclick="onSubmitButton();" >
                            <pe:exporter type="xlsx" target="tb1" fileName="hr_report_month_end_employee_date_1"  />
                        </p:commandButton>
                        <p:commandButton value="Print" ajax="false" action="#" >
                            <p:printer target="gpBillPreview" ></p:printer>
                        </p:commandButton>
                        <p:panel id="gpBillPreview" style="font-size: 12px;"  >                     
                            <p:dataTable id="tb1" value="#{hrReportController.monthEndRecords}" var="ss" styleClass="noBorder summeryBorder" 
                                         rowStyleClass="#{ss.workedDays lt 6 ? 'redText':ss.workedDays lt 11 ? 'blueText':''}">
                                <f:facet name="header">
                                    <h:outputLabel value="Employee Salary Detail Report"/>
                                    <br/>
                                    <p:outputLabel value="Salary Date - From : " />
                                    <h:outputLabel value="#{hrReportController.reportKeyWord.salaryCycle.salaryFromDate}">
                                        <f:convertDateTime pattern="dd MM yyyy"/>
                                    </h:outputLabel>
                                    <p:outputLabel value="To : " />
                                    <h:outputLabel value="#{hrReportController.reportKeyWord.salaryCycle.salaryToDate}">
                                        <f:convertDateTime pattern="dd MM yyyy"/>
                                    </h:outputLabel>
                                    <br/>
                                    <p:outputLabel value="OT Date - From : " />
                                    <h:outputLabel value="#{hrReportController.reportKeyWord.salaryCycle.dayOffPhFromDate}">
                                        <f:convertDateTime pattern="dd MM yyyy hh:mm:ss a"/>
                                    </h:outputLabel>
                                    <p:outputLabel value="To : " />
                                    <h:outputLabel value="#{hrReportController.reportKeyWord.salaryCycle.dayOffPhToDate}">
                                        <f:convertDateTime pattern="dd MM yyyy hh:mm:ss a"/>
                                    </h:outputLabel>
                                    <h:panelGroup rendered="#{hrReportController.reportKeyWord.roster ne null}">
                                        <br />
                                        <h:outputLabel value="#{hrReportController.reportKeyWord.roster.name} Roster" rendered="#{hrReportController.reportKeyWord.roster ne null}"/>
                                        <br />
                                    </h:panelGroup>

                                    <h:panelGroup rendered="#{hrReportController.reportKeyWord.staff ne null}">
                                        <br />
                                        <h:outputLabel value="Employee #{hrReportController.reportKeyWord.staff.person.name}" rendered="#{hrReportController.reportKeyWord.staff ne null}"/>
                                        <br />
                                    </h:panelGroup>

                                    <h:panelGroup rendered="#{hrReportController.reportKeyWord.institution ne null}">
                                        <br />
                                        <h:outputLabel value="#{hrReportController.reportKeyWord.institution.name}" rendered="#{hrReportController.reportKeyWord.institution ne null}"/>
                                        <br />
                                    </h:panelGroup>

                                    <h:panelGroup rendered="#{hrReportController.reportKeyWord.department ne null}">
                                        <br />
                                        <h:outputLabel value="#{hrReportController.reportKeyWord.department.name} Department" rendered="#{hrReportController.reportKeyWord.department ne null}"/>
                                        <br />
                                    </h:panelGroup>

                                    <h:panelGroup rendered="#{hrReportController.reportKeyWord.staffCategory ne null}">
                                        <br />
                                        <h:outputLabel value="Staff Category #{hrReportController.reportKeyWord.staffCategory.name}" rendered="#{hrReportController.reportKeyWord.staffCategory ne null}"/>
                                        <br />
                                    </h:panelGroup>

                                    <h:panelGroup rendered="#{hrReportController.reportKeyWord.designation ne null}">
                                        <br />
                                        <h:outputLabel value="Staff Designation #{hrReportController.reportKeyWord.designation.name}" rendered="#{hrReportController.reportKeyWord.designation ne null}"/>
                                        <br />
                                    </h:panelGroup>
                                </f:facet>
                                <p:column headerText="Staff Code" style="text-align: left;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Staff Code" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.staff.codeInterger}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Staff" style="text-align: left;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Staff" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.staff.person.name}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Worked Days" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Worked Days" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.workedDays}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Worked Days Before" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Worked Days Before" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.workedDaysBefore}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Worked Days This" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Worked Days This" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.workedDaysThis}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Worked Days Aditional" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Worked Days Aditional" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.workedDaysAditional}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Annual Leave" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Annual Leave" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.leave_annual}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Casual Leave" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Casual Leave" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.leave_casual}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Medical Leave" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Medical Leave" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.leave_medical}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Medical Leave" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Maternity Leave" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.leave_maternity}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="No Pay Leave" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="No Pay Leave" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.leave_nopay-ss.lateNoPays}" style="font-size: 12px;"/>
                                </p:column>                             
                                <p:column headerText="Late No Pay Days" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Late No Pay Days" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.lateNoPays}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Late Days" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Late Days" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.latedays}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Merhcantile Days" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Merhcantile Days" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.merhchantileDays}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Merhcantile Days(Leave)" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Merhcantile Days(Leave)" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.merhchantileDaysLeave}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Poya Days" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Poya Days" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.poyaDays}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Poya Days(Leave)" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Poya Days(Leave)" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.poyaDaysLeave}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column headerText="Off Days" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Off Days" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.dayoff}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{!hrReportController.reportKeyWord.additionalDetails}" headerText="Sleeping Days" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Sleeping Days" />
                                    </f:facet>
                                    <p:outputLabel value="#{ss.sleepingDays}" style="font-size: 12px;"/>
                                </p:column>
                                <p:column rendered="#{hrReportController.reportKeyWord.additionalDetails}" headerText="Remarks" style="text-align: right;">
                                    <f:facet name="header" >
                                        <p:outputLabel value="Remarks" />
                                    </f:facet>
                                    <p:outputLabel value="......................................................................."/>
                                </p:column>

                            </p:dataTable>
                            <p:panel header="New Comer" >
                                <table rendered="#{hrReportController.reportKeyWord.additionalDetails}" border="1px solid black" align="center" >
                                    <tr>
                                        <td width="50" style="font-size: 9px">E.No</td>
                                        <td width="50" style="font-size: 9px">EPF No</td>
                                        <td width="60" style="font-size: 9px">Date Of Join</td>
                                        <td style="font-size: 9px">Basic Salary+BR</td>
                                        <td style="font-size: 9px">T. Allowance </td>
                                        <td style="font-size: 9px">Per. Allowance</td>
                                        <td width="350" style="font-size: 9px">Name</td>
                                        <td width="100" style="font-size: 9px">Designation</td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    <!--                                    <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>&nbsp;</td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                            <td></td>
                                                                        </tr>-->
                                </table>

                                <h:panelGrid columns="3" styleClass="noBorder" >
                                    <p:outputLabel value="Checked By" style="text-decoration: overline;" />
                                    <p:spacer width="400px" height="100px"/>
                                    <p:outputLabel value="Authorized By" style="text-decoration: overline; " />
                                </h:panelGrid>
                            </p:panel>

                        </p:panel>


                    </p:panel>

                </h:form>
            </ui:define>

        </ui:composition>

    </h:body>
</html>
